# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-photos
pkgver=3.30.1
pkgrel=1
pkgdesc="Access, organize, and share your photos on GNOME"
arch=(x86_64)
url="https://wiki.gnome.org/Apps/Photos"
license=(GPL)
depends=(exempi gtk3 libexif librsvg babl gegl gsettings-desktop-schemas grilo-plugins lcms2
         tracker-miners geocode-glib grilo gfbgraph libgdata libgexiv2 libraw gnome-online-accounts
         gnome-online-miners dleyna-server dleyna-renderer libdazzle)
makedepends=(python yelp-tools git meson)
groups=(gnome)
_commit=c7f55291c49ad26d1f7f2511481901ad16f813a2  # tags/3.30.1^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-photos.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgd.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.subprojects/libgd.url "$srcdir/libgd"
  git submodule update

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --enable-compile-warnings=minimum
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  # disabled: needs dogtail and an installed gnome-photos
  #xvfb-run dbus-run-session make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
